package com.syas.web.controllers;

import com.syas.service.interfaces.IRateService;
import com.syas.web.auth.AuthPassport;
import com.syas.web.models.FmgerSearchModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping(value = "/target")
public class RateController extends BaseController {

	@Autowired
    @Qualifier("RateService")
    private IRateService rateService;

    @AuthPassport
	@RequestMapping(value="/rateList", method = {RequestMethod.GET})
    public String list(HttpServletRequest request, Model model, FmgerSearchModel searchModel){
        model.addAttribute("requestUrl", request.getServletPath());
        model.addAttribute("requestQuery", request.getQueryString());
        model.addAttribute("searchModel", searchModel);
        //提成比率列表
        model.addAttribute("contentModel", rateService.getRateList());
        return "target/rateList";
    }
}
